package com.bruce.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bruce.dao.RoleDao;
import com.bruce.model.Role;
import com.bruce.service.RoleService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Service
public class RoleServiceImpl  implements RoleService{
	@Autowired
	private RoleDao roleDao;
	@Override
	public int insert(Role impl) {
		// TODO Auto-generated method stub
		return roleDao.insert(impl);
	}

	@Override
	public int update(Role impl) {
		// TODO Auto-generated method stub
		return roleDao.update(impl);
	}

	@Override
	public PageInfo<Role> selectAll(int pageNum, int pageSize) {
		// TODO Auto-generated method stub
		PageHelper.startPage(pageNum, pageSize);
		return new PageInfo<Role>(roleDao.selectAll());
	}

	@Override
	public int getId(Role impl) {
		// TODO Auto-generated method stub
		return roleDao.getId(impl);
	}
}
